package com.zhl.spark.core.rddtransform

import com.zhl.spark.core.BasicRdd

/**
 * @program: demos
 * @description: ${description}
 * @author: 刘振华
 * @create: 2020-12-01 10:56
 **/
object SortRdd extends BasicRdd {
    def main(args: Array[String]): Unit = {
        test()
    }

    override def logic(): Unit = {
        val rdd = sc.makeRDD(List(("4",4),("1",1),("11",2),("2",3)))

//        rdd.sortBy(_._1).collect().foreach(println)
        //false表示降序
        rdd.sortBy(_._2,false).collect().foreach(println)
    }
}
